//
//  outBottomTableViewCell.m
//  AirQuality
//
//  Created by Mac on 16/1/19.
//  Copyright © 2016年 Po. All rights reserved.
//

#import "outBottomTableViewCell.h"

@implementation outBottomTableViewCell


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)setDataValue:(NSString *)value type:(NSString *)type withColNum:(NSString *)colNum
{
    NSString * unit;
    _aqiValue.layer.cornerRadius = 5.0;
    _aqiValue.layer.masksToBounds = YES;
    if ([type isEqualToString:@"AQI"]) {
        unit = @"";
    }else if ([type isEqualToString:@"CO"]){
        unit = @"mg/m³";
    }else{
        unit = @"µg/m³";
    }
    if ([colNum floatValue] == 0) {
        [_aqiValue setText:[NSString stringWithFormat:@"%@",@"—"]];
    }else{
        [_aqiValue setText:[NSString stringWithFormat:@"%@%@",value,unit]];
    }
    [_aqiValue setTextColor:[UIColor whiteColor]];
    NSString * trueKey = [RJTools getTrueTypeTitlleWithCellKey:type];
    [_aqiValue setBackgroundColor:[RJTools getColorWithAirNum:[colNum floatValue] type:type alpha:1]];
    if ([colNum floatValue] == 0) {
        _aqiValue.backgroundColor = [UIColor grayColor];
    }
}

@end
